package com.autumn.mybatis.provider.mysql;

import com.autumn.mybatis.provider.AbstractProvider;
import com.autumn.mybatis.provider.ICommandBuilder;
import com.autumn.mybatis.provider.IDefinitionBuilder;
import com.autumn.mybatis.provider.IDeleteBuilder;
import com.autumn.mybatis.provider.IInsertBuilder;
import com.autumn.mybatis.provider.IQueryBuilder;
import com.autumn.mybatis.provider.IUpdateBuilder;
import com.autumn.mybatis.provider.ProviderDriveType;
import com.autumn.mybatis.provider.annotation.ProviderDrive;
import com.autumn.mybatis.provider.mysql.builder.MySqlCommandBuilder;
import com.autumn.mybatis.provider.mysql.builder.MySqlDefinitionBuilder;
import com.autumn.mybatis.provider.mysql.builder.MySqlDeleteBuilder;
import com.autumn.mybatis.provider.mysql.builder.MySqlInsertBuilder;
import com.autumn.mybatis.provider.mysql.builder.MySqlQueryBuilder;
import com.autumn.mybatis.provider.mysql.builder.MySqlUpdateBuilder;

/**
 * MySql提供者
 * 
 * @author 杨昌国
 *
 *         2017-10-19 08:25:07
 */
@ProviderDrive(name = "MySql", type = ProviderDriveType.MYSQL)
public class MySqlProvider extends AbstractProvider {

	private MySqlInsertBuilder insertBuilder;
	private MySqlUpdateBuilder updateBuilder;
	private MySqlDeleteBuilder deleteBuilder;
	private MySqlQueryBuilder queryBuilder;
	private MySqlDefinitionBuilder definitionBuilder;
	private MySqlCommandBuilder commandBuilder;

	/**
	 * 
	 */
	public MySqlProvider() {
		this.insertBuilder = new MySqlInsertBuilder(this);
		this.updateBuilder = new MySqlUpdateBuilder(this);
		this.deleteBuilder = new MySqlDeleteBuilder(this);
		this.queryBuilder = new MySqlQueryBuilder(this);
		this.definitionBuilder = new MySqlDefinitionBuilder(this);
		this.commandBuilder = new MySqlCommandBuilder(this);
	}

	@Override
	public IInsertBuilder getInsertBuilder() {
		return this.insertBuilder;
	}

	@Override
	public IUpdateBuilder getUpdateBuilder() {
		return this.updateBuilder;
	}

	@Override
	public IDeleteBuilder getDeleteBuilder() {
		return this.deleteBuilder;
	}

	@Override
	public IQueryBuilder getQueryBuilder() {
		return this.queryBuilder;
	}

	@Override
	public IDefinitionBuilder getDefinitionBuilder() {
		return this.definitionBuilder;
	}

	@Override
	public int getConnectType() {
		return ProviderDriveType.MYSQL.getConnectType();
	}

	@Override
	public ICommandBuilder getCommandBuilder() {
		return this.commandBuilder;
	}

}
